<template>

  <!--开始必须新建一个div根目录-->
  <div>
    <table border="1" cellpadding="0" cellspacing="0" align="center">
      <tr>
        <td>分类名称</td>
        <td>操作</td>
      </tr>
      <tr v-for="i in show_classify">
        <td>{{i.name}}</td>
        <td>
          <button @click="show_book(i.id)">查看</button>
        </td>
      </tr>
    </table>
    {{ list }}
  </div>
</template>

<script>
export default {
  name: "show_classify",
  data() {
    return {
      show_classify:[],
      list:[],
    }
  },

  methods: {
    classify(){
      this.$axios.get('users/classifyM/')
      .then(res=>{
          this.show_classify = res.data.list
      })
    },
    show_book(id){
      this.$axios.get('users/show_ClassifyM/?id='+id)
        .then(res => {
          this.list = res.data.list
        })
    }
  },

  computed: {},

  mounted() {
    this.classify()
  }
}
</script>

<style scoped>

</style>
